package org.wattdepot.gdata.kukuicup.service;

import static org.junit.Assert.assertTrue;
import org.junit.Test;
import org.wattdepot.gdata.kukuicup.GDataProperties;

/**
 * Tests the GDataView class.
 * @author Philip Johnson
 */
public class TestGDataView {
  /** Sample spreadsheet name. */
  private String spreadsheetName = "KukuiCupData";
  
  /**
   * Tests that we can retrieve the contents of the LatestPower spreadsheet..
   * @throws Exception If problems occur. 
   */
  @Test
  public void testGDataView() throws Exception {
    GDataProperties properties = new GDataProperties();
    GDataService service = new GDataService(properties);
    GDataView view = new GDataView(service, 
        service.getSpreadsheetURL(spreadsheetName));
    // Just check to see that we have some data in the retrieved spreadsheet.
    assertTrue("Testing GDataView", (view.size() > 0));
  }
}
